package com.test.fundible.fundible_05_process;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.test.fundible.R;


public class BindA_fundiblecc_fundibleountTipDialog_Fr extends Dialog {

    private final Runnable submitRunnable_fundible;

    public BindA_fundiblecc_fundibleountTipDialog_Fr(@NonNull Context context, Runnable submitRunnable) {
        super(context);
        this.submitRunnable_fundible = submitRunnable;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_bind_fundible_account_tip_fr);
        initView_fundible();
    }

    @SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
    private void initView_fundible(){

        getWindow().setBackgroundDrawableResource(R.color.transparent);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        findViewById(R.id.dbfatf_view_out).setOnClickListener(v -> dismiss());
        findViewById(R.id.dbfatf_view_in).setOnTouchListener((v, event) -> true);

        findViewById(R.id.dbfatf_btn_add).setOnClickListener(v -> dismiss());

        findViewById(R.id.dbfatf_btn_no_account).setOnClickListener(v -> {
            dismiss();
            if (submitRunnable_fundible !=null) submitRunnable_fundible.run();
        });

    }


}
